<!DOCTYPE html>
<html lang="en">
<head>
    <title>处方列表</title>
    <titleType style="display: none;">yjjList</titleType>
    <%- include('../../../_global/baseLibs') %>
    <script src="/static/lib/forweb.js"></script>
    <script src="/static/js/aboutPay.js"></script>
    <script src="/quickJs/scripts/swiper/3.4.2/js/swiper.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/css/payment.css">
    <script src="/quickJs/scripts/common/md5.js"></script>


</head>
<style>
    .hospital-detail .hospital-jj-box .text-box span.yellow {
        margin-left: 0.5rem !important;
    }
</style>
<script type="text/javascript">

</script>

<body>

<header class="header-box fixed grey">
    <div class="header-content">
        <div class="left-tool">
            <a class="back" href="javascript:void(0);"><i class="iconfont icon-back"></i></a>
        </div>
        <div class="title">处方列表</div>
    </div>
</header>
<section class="page-wrap hospital-detail" style="width: 100%;position: absolute;">
    <div id="ListTabBox">
        <div class="tab active" id="allBill" index="0">


        </div>
    </div>
</section>




</body>

</html>
<script type="text/html" id="Tpl">
    {{each data}}
    <div class="presList">
        <ul class="bilsContent" >
            <li><span class="grayFont">开方时间 :</span> {{$value.kfsj}}</li>
            <li><span class="grayFont">开方医生姓名 :</span>{{$value.kfysxm}}</li>
            <li><div><span class="grayFont">开方科室名称:</span>  {{$value.kfksmc}}</div>
            </li>
            <li><span class="grayFont">处方号码 :</span>{{$value.cfhm}}</li>
            <li><span class="grayFont">处方金额 :</span>{{$value.cfje}}</li>
        </ul>
    </div>
    {{/each}}
</script>
<script>



    var page_presListing = (function($, page_presListing) {

        function initAllData() {
            // 动态获取选择的数据
            var queryParams = StoreCache.getCache("searchInfo");
            prescription={
                "yljgdm" : queryParams.hosCode,
                "klx" : "01",
                "kh" : queryParams.patientCardId,
                "zzkfsj" : queryParams.beginTime,
                "zwkfsj" : queryParams.endTime,
                "jzlsh" : ""
            }
            // prescription = {
            //     "yljgdm" : "740035778",
            //     "klx" : "01",
            //     "kh" : "510123199101273421",
            //     "zzkfsj" : "2017-01-01",
            //     "zwkfsj" : "2017-12-31",
            //     "jzlsh" : ""
            // };
            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/ynzf/report/getPrescriptionRecord"
                ,params: prescription
                ,callback: prescriptionList
            });
            function prescriptionList(data) {
                var arr = data;
                var str="";
                if(arr.length>0){
                    var data = template("Tpl", {data:arr});

                    $('#allBill').append(data);
                }


            }


        }

        function  redirect() {
            $.QuickUrlUtils.redirectJSBridge({url:"/html/gzd/HospitalService/electPrescription/presDetail.html"});

        }
        var cfg_def = {
            initAllData: initAllData,
            redirect: redirect,
        }

        page_presListing.init = function(cfg){
            $.extend(page_presListing, cfg_def, cfg);
            page_presListing.initAllData();
            $(".bilsContent").on("click", page_presListing.redirect);

        }

        return page_presListing;
    })(jQuery, {});
    

</script>




